package com.roc.util.constant;

import org.apache.commons.lang3.StringUtils;

public enum OrgPayStatus {
	PAY_RESULT_SUCCESS("00","出款结果成功"),
	PAY_APPLY_WHILE("01","出款申请中"),
	PAY_APPLY_SUCCESS("02","出款申请成功"),
	PAY_RESULT_FAILED("03","出款结果失败"),
	PAY_HANDLE("04","出款申请处理中"),
	PAY_RG("05","人工处理"),
	
	TRANS_D0B("2201","D0补付"),
	TRANS_T1B("2301","T1代付"),
	TRANS_T1("2401","T1补付");
	
	private String code;
	private String name;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	private OrgPayStatus(String code, String name) {
		this.code = code;
		this.name = name;
	}
	
	public static OrgPayStatus valueOfCode(String code) {
		if (StringUtils.isBlank(code)) {
			throw new IllegalArgumentException("PayStatus " + code
					+ " is blank");
		}
		for (OrgPayStatus mt : values()) {
			if (mt.getCode().equals(code)) {
				return mt;
			}
		}
		throw new IllegalArgumentException("PayStatus " + code
				+ " is not exist");
	}
}
